import request from '@/utils/request'

// 查询商品分类
export function getCategoryList(params) {
	return request({
		url: '/product/category/list',
		method: 'GET',
		params
	})
}

// 更新商品分类
export function updateCategory(data) {
	return request({
		url: '/product/category/update',
		method: 'PUT',
		data
	})
}

// 删除商品分类
export function deleteCategory(id) {
	return request({
		url: `/product/category/delete?id=${id}`,
		method: 'DELETE',
	})
}

// 获得商品分类
export function getCategory(id) {
	return request({
		url: `/product/category/get?id=${id}`
	})
}

// 创建商品分类
export function createCategory(data) {
	return request({
		url: '/product/category/create',
		'method': 'POST',
		'data': data
	})
}